package BinaryTree;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree=new BinaryTree();
        BinaryTree.TreeNode root=binaryTree.createTree();
        BinaryTree.TreeNode root2=binaryTree.createTree2();
        System.out.println("判断两棵树是否相同：");
        System.out.println(binaryTree.isSameTree(root, root2));
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        binaryTree.levelOrder(root);
        System.out.println();
        System.out.println("树节点的个数："+binaryTree.size(root));
        System.out.println("树节点的个数："+binaryTree.size2(root));
        System.out.println("叶子节点的个数："+binaryTree.getLeafNodeCount(root));
        System.out.println("叶子节点的个数："+binaryTree.getLeafNodeCount2(root));
        System.out.println("第K层节点的个数："+binaryTree.getKLevelNodeCount(root,3));

    }

   }
